package com.shop.domain.store;

import java.util.Date;
import java.math.BigDecimal;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.*;
import javax.persistence.Table;

import com.alibaba.fastjson.annotation.JSONField;
import com.shop.jpa.domain.BaseDomain;
import com.shop.jpa.support.JpaConst;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import lombok.Data;

/**
 * <p>StoreProduct 实体类</p>
 * <p>Table: t_store_product - 商品表</p>
 * @author generator
 * @date 2021-02-08 04:17:03
 */
@ApiModel("StoreProduct 实体类")
@Data
@Entity
@EntityListeners(AuditingEntityListener.class)
@Table(name = "t_store_product")
@SQLDelete(sql = "update t_store_product set is_deleted = 1 where id = ?")
@Where(clause = JpaConst.WHERE_CLAUSE_NOT_DELETED)
@DynamicInsert(true)
@DynamicUpdate(true)
public class StoreProduct extends BaseDomain implements Serializable {

    @ApiModelProperty(value = "id", hidden = true)
	@Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
	@JSONField(serialize=false)
    private Long id;

    /**
	 * 商品图片
	 */
    @ApiModelProperty("商品图片")
	@Column(name = "image")
    private String image;

    /**
	 * 轮播图
	 */
    @ApiModelProperty("轮播图")
	@Column(name = "slider_image")
    private String sliderImage;

    /**
	 * 商品名称
	 */
    @ApiModelProperty("商品名称")
	@Column(name = "store_name")
    private String storeName;

    /**
	 * 商品简介
	 */
    @ApiModelProperty("商品简介")
	@Column(name = "store_info")
    private String storeInfo;

    /**
	 * 关键字
	 */
    @ApiModelProperty("关键字")
	@Column(name = "keyword")
    private String keyword;

    /**
	 * 分类id
	 */
    @ApiModelProperty("分类id")
	@Column(name = "cate_id")
    private Long cateId;

    /**
     * 原始价格
     */
    @ApiModelProperty("原始价格")
    @Column(name = "origin_price")
    private BigDecimal originPrice;

    /**
	 * 商品价格
	 */
    @ApiModelProperty("商品价格")
	@Column(name = "price")
    private BigDecimal price;

    /**
	 * 单位名
	 */
    @ApiModelProperty("单位名")
	@Column(name = "unit_name")
    private String unitName;

    /**
	 * 排序
	 */
    @ApiModelProperty("排序")
	@Column(name = "sort")
    private Short sort;

    /**
	 * 销量
	 */
    @ApiModelProperty("销量")
	@Column(name = "sales")
    private Integer sales;

    /**
	 * 状态（0：未上架，1：上架）
	 */
    @ApiModelProperty("状态（0：未上架，1：上架）")
	@Column(name = "is_show")
    private Integer isShow;

    /**
	 * 是否热卖
	 */
    @ApiModelProperty("是否热卖")
	@Column(name = "is_hot")
    private Integer isHot;

    /**
	 * 是否精品
	 */
    @ApiModelProperty("是否精品")
	@Column(name = "is_best")
    private Integer isBest;

    /**
	 * 是否新品
	 */
    @ApiModelProperty("是否新品")
	@Column(name = "is_new")
    private Integer isNew;

    /**
	 * 是否拼团商品 0 未开启 1已开启
	 */
    @ApiModelProperty("是否拼团商品 0 未开启 1已开启")
	@Column(name = "is_pink")
    private Integer isPink;

    /**
     * 拼团类型ID
     */
    @ApiModelProperty("拼团类型ID")
    @Column(name = "pink_id")
    private Long pinkId;

    /**
	 * 是否优品推荐
	 */
    @ApiModelProperty("是否优品推荐")
	@Column(name = "is_good")
    private Integer isGood;

    /**
	 * 主图视频链接
	 */
    @ApiModelProperty("主图视频链接")
	@Column(name = "video_link")
    private String videoLink;

    /**
     * 淘宝京东数据来源
     */
    @ApiModelProperty("淘宝京东数据来源")
    @Column(name = "soure_link")
    private String soureLink;


    /**
	 * 规格 0单 1多
	 */
    @ApiModelProperty("规格 0单 1多")
	@Column(name = "spec_type")
    private Integer specType;

    /**
     * 规格 0单 1多
     */
    @ApiModelProperty("库存")
    @Column(name = "stock")
    private Integer stock;

    /**
     * 创建时间
     */
    @ApiModelProperty("创建时间")
    @Column(name = "create_time")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 修改时间
     */
    @ApiModelProperty("修改时间")
    @Column(name = "update_time")
    @JSONField(serialize=false)
    private Date updateTime;

  
    /**
     * 是否删除
     */
    @ApiModelProperty("是否删除")
    @Column(name = "is_deleted")
    @JSONField(serialize=false)
    private Integer isDeleted;
}